package midoo.server.simple;

import midoo.server.core.MMessage;
import midoo.server.core.MWorker;

/**
 * Created by ajianzheng on 2015/4/10.
 *
 */
public class MSimpleWorkerImpl extends MWorker {
    @Override
    public int start(String[] args) throws Exception {
        LOGGER.info("start");

        return 0;
    }

    @Override
    public void stop() {
        LOGGER.info("stop");
    }

    @Override
    public int handleProcess(MMessage message) {
        long cost = System.currentTimeMillis()- message.getProcessStartTimeMillis();
        if (cost > 1000) {
            LOGGER.error("!!!!!!!!!!!!!!!!!!!! cost:{}", cost);
        }
        message.sendToClient(message.getMessage());

        return 0;
    }
}
